﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using OAclient.Models;
using ServiceApplication.Service.WorkFlow;
using ServiceApplication.Service;
using System.Data;
using CommonLibrary.DataModel.Form;
using CommonLibrary.DataModel.WorkFlow;
using CommonLibrary.Common;
using System.Xml.Linq;
using Bukovics.Workflow.Hosting;
using CommonLibrary.DataModel.Basic;
using ServiceApplication.Service.Basic;
using System.Workflow.Activities;
using CommonLibrary.Wf.InterFace;
using System.Workflow.Runtime;
using System.IO;
using System.Xml;
using ServiceApplication.Dao.WorkFlow;
using System.Workflow.ComponentModel;
using System.Workflow.Runtime.Hosting;
using System.Transactions;
using ServiceApplication.Dao.Basic;
using OAclient.Common;
using OAclient.Filters;
using System.Web.UI.WebControls;

namespace OAclient.Controllers
{
    public class GzzdController : Controller
    {

        BasicService bs = new BasicService();
        //
        // GET: /Gzzd/

        //规章制度内容
        //gzzd-1
        public ActionResult GzzdList(UserModel user, int? page)
        {
            return View();
        }

        public String Select()
        {
            var entity = bs.QueryDetail();
            String context;
            if (null == entity)
                context = "当前无条目";
            else
                context = entity.gzzd_detail;
            return context;
        }


        //修改规章制度内容
        //gzzd-2
        public ActionResult GzzdMrg(UserModel user, int? page)
        {
            return View();
        }


        public String ReturnDetail()
        {
            String context = bs.QueryDetail() == null ? string.Empty : bs.QueryDetail().gzzd_detail;

            context = Server.HtmlDecode(context);

            return context;
        }

        public String Submit(String Fckcontext,String Fckcontext2)
        {
            String context = Server.HtmlDecode(Fckcontext);
            String contexts = Server.HtmlEncode(context);

            String context2 = Server.HtmlDecode(Fckcontext2);

            GzzdEntity gzzdEntity = new GzzdEntity();
            gzzdEntity.gzzd_detail = context;
            gzzdEntity.gzzd_detail2 = context2;
            gzzdEntity.gzzd_xgsj = DateTime.Now.ToString("yyyy-MM-dd");

            bs.AddNewRules(gzzdEntity);

            return context;
        }


    }
}
